<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>

    function Person(){
        this.eyes = 2;
        this.head = 1;
    }
    //借助原型对象实现继承
    function Woman(){  
    }
    Woman.prototype = new Person();
    Woman.prototype.constructor = Woman;

    //给女人添加一个方法
    Woman.prototype.baby = function(){
        console.log('宝贝');
    }
    const red = new Woman();
    red.baby();
    

</script>
</html>